import service from "./request";

// 每一个请求 封装成一个函数

//* 注册请求
export function user_register(params = {}) {
    return service.post('/user/register', params)
}

//* 登录请求
export function user_login(params = {}) {
    return service.post('/user/login', params)
}

//* 轮播图请求
export function banner_list(params = {}) {
    return service.get('/banner/list', { params })
}

//* 店铺列表请求
export function shop_list(params = {}) {
    return service.get('/shop/list', { params })
}

//* 店铺详情
export function shopinfo_list(params = {}) {
    return service.get('/shop/shopinfo', { params })
}

//* 店铺-收藏列表
export function favlist_list(params = {}) {
    return service.get('/shop/favlist', { params })
}

//* 店铺-收藏店铺
export function fav_login(params = {}) {
    return service.post('/shop/fav', params)
}

//* 取消收藏
export function unfav_login(params = {}) {
    return service.post('/shop/unfav', params)
}

//* 购物车列表
export function shopcart_list(params = {}) {
    return service.get('/shopcart/list', { params })
}

//* 购物车清空
export function clear_login(params = {}) {
    return service.post('/shopcart/clear', params)
}

//* 购物车数量加1
export function add_login(params = {}) {
    return service.post('/shopcart/add', params)
}

//* 店铺搜索
export function search_list(params = {}) {
    return service.get('/shop/search', { params })
}

//* 购物车数量减1
export function sub_login(params = {}) {
    return service.post('/shopcart/sub', params)
}

//* 收获地址-查询渲染
export function address_list(params = {}) {
    return service.get('/address/list', { params })
}

//* 新增收货地址
export function xinzeng_address(params = {}) {
    return service.post('/address/add', params)
}

//* 收货地址删除
export function delete_address(params = {}) {
    return service.post('/address/del', params)
}

//* 爆爆团-列表请求
export function baobao_list(params = {}) {
    return service.get('/tuan/list', { params })
}

//todo 收货地址编辑
export function edit_address(params = {}) {
    return service.post('address/edit', params)
}




//! 模拟 post 请求实例
// export function user_login(params = {}) {
//     return service.get('/user/list', params)
// }